# Maintainer: Maxime Gauduin <alucryd@archlinux.org>

pkgname=libretro-reicast
pkgver=3485
pkgrel=1
pkgdesc='Sega Dreamcast core'
arch=(loong64 x86_64)
url='https://github.com/libretro/reicast-emulator'
license=(GPL2)
groups=(libretro)
depends=(
  libgl
  libretro-core-info
)
makedepends=(
  git
  mesa
)
_commit='57b76774c6f5a9c5830b911f701a3cc99ae2c16a'
source=(
  libretro-reicast::git+https://github.com/libretro/reicast-emulator.git#commit=${_commit}
  libretro-reicast-flags.patch
)
sha256sums=(
  SKIP
  051f6fda81d816a8f8c58748565ba4db73a18d0d788e520dc343839471606709
)

pkgver() {
  cd libretro-reicast

  git rev-list --count HEAD
}

prepare() {
  cd libretro-reicast

  patch -Np1 -i ../libretro-reicast-flags.patch
}

build() {
  make -C libretro-reicast
}

package() {
  install -Dm 644 libretro-reicast/reicast_libretro.so -t "${pkgdir}"/usr/lib/libretro/
}

# vim: ts=2 sw=2 et:
